
proc primes*(n: int): seq[int] = 
  ## sieve of Eular

  if n < 2: return

  var sieve = newSeq[bool](n+1)
  for i in 2..n:
    if not sieve[i]:
      result.add i
    for j in result:
      var k = i * j
      if k > n: break
      sieve[k] = true
      if i mod j == 0: break
